angular.module("app").run(["$rootScope", function ($rootScope) {
    if (location.host.indexOf("localhost") >= 0) {
        // $rootScope.sysOrigin = "http://test.dakaqi.cn:3030/platform";
        $rootScope.sysOrigin = "/api";
    }
    else {
        $rootScope.sysOrigin = "/platform";
    }
    $rootScope.$on("$stateChangeStart", function (event, toState, toParams, fromState, fromParams) {
        if (toState.name.indexOf("home") >= 0 && !sessionStorage.userInfo) {
            event.preventDefault();
            location.href = "#/login";
        }
    })
}]);